package com.hmall.controller;


import com.hmall.domain.po.Information;
import com.hmall.service.IInformationService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author HBQ
 * @since 2025-10-22
 */
@RestController
@RequestMapping("/information")
@RequiredArgsConstructor

public class InformationController {

    private final IInformationService informationService;

    @PostMapping
    @ApiOperation("新增信息")
    public boolean save(Information information){
        return informationService.saveByUserId(information);
    }


    @GetMapping("/{id}")
    @ApiOperation("数据回显")
    public Information get(@PathVariable Long id){
        return informationService.getByUserId(id);
    }

//    @PutMapping
//    @ApiOperation("更新信息")
//    public boolean update(Information information){
//        return informationService.updateByUserId(information);
//    }

}
